
<!--#include file="../inc/conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>抽奖后台管理</title>
<link href="ui/css/layui.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="ui/jquery.js"></script>




</head>

<body>
<div class="layui-layout layui-layout-admin">


<div class="layui-header">
    <div class="layui-logo">Lottery后台管理</div>

    <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item"><a href="lottery.asp">抽奖列表</a></li>
   
      <li class="layui-nav-item"><a href="../">查看前台</a></li>
     <li class="layui-nav-item"><a href="http://book.9416.cn">在线交流</a></li>
    
    </ul>
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="../img/user_03.jpg" class="layui-nav-img">
          admin
        </a>
        <dl class="layui-nav-child">
          <dd><a href="">基本资料</a></dd>
          <dd><a href="">安全设置</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="">退出</a></li>
    </ul>
  </div>




<div class="layui-main" style="padding: 15px;">
	<div class="layui-breadcrumb">
    <span>位置：</span>
  <a href="#">首页</a>
  <a href="#">抽奖活动管理</a>

    </div>
    
   

 
<div style="float:right; margin-bottom:15px" onclick="tc('发布抽奖','lottery_add.asp',1000,800)" class="layui-btn ">发布抽奖</div>


 
	
<div class="layui-form" >
  	  <table width="100%" class="layui-table">
    	<thead>
    	<tr>
        <th>活动名称</th>
        <th>抽奖次数</th>
        <th>起止时间</th>
        <th>抽奖状态</th>
          <th>中奖纪录</th>
        <th>操作</th>
        </tr>
        </thead>
       
        <%
   sql="select * from [lottery] order by zt desc "
  rst.open sql,conn,1,1
  do while not rst.eof
  if datediff("s",rst("sttime"),now())<0 then
lot_time="<div class='layui-badge layui-bg-blue'>未开始</div>"
end if

if datediff("s",rst("sttime"),now())>=0 and datediff("s",rst("endtime"),now())<=0 then
lot_time="<span class='layui-badge layui-bg-danger' >进行中</span>"
end if


if  datediff("s",rst("endtime"),now())>0 then
lot_time="<div class='layui-badge layui-bg-gray ' >已结束</div>"
end if 

  
  %>
  
        <tr>
          <td><%=rst("title")%></td>
            <td><%=rst("cnum")%></td>
           <td><%=rst("sttime")%>-<%=rst("endtime")&lot_time%></td>
          <td>
		    <%if rst("zt")="1" then
			response.Write "开启"
			else
			response.Write "关闭"
			end if


  %>
          </td>
          <td> <a href="javascript:void(0)"  onclick="tc('中奖纪录','lottery_win.asp?title=<%=rst("title")%>',1000,800)" >
<button class="layui-btn layui-btn-sm">
   中奖纪录
  </button>
            </a></td>
          <td>  
        
          <a href="javascript:void(0)"  onclick="tc('修改信息','lottery_edit.asp?id=<%=rst("id")%>',1000,800)" >
<button class="layui-btn layui-btn-sm">
    <i class="layui-icon">&#xe642;</i>
  </button>
            </a>
        
            <a href="javascript:void(0)"  onclick="del('lottery',<%=rst("id")%>)" >
  <button class="layui-btn layui-btn-sm">
    <i class="layui-icon">&#xe640;</i>
  </button></a>
          </td>
        </tr> 
   
        <%rst.movenext
		loop
		rst.close%>
       
    </table>
    </div>
   
  
   
   
   
   
   </div>
<div class="layui-footer">
    <!-- 底部固定区域 -->
    ©9416.cn 版权所有
  </div>
   </div>


<script type="text/javascript" src="ui/layui.js"></script>
<script type="text/javascript" src="ui/main.js"></script>

</body>

</html>
